Methods and apparatuses for classifying electronic documents

ABSTRACT

Embodiments of the invention provide methods and apparatuses for classifying electronic documents (e.g., electronic communications) as either spam electronic documents or legitimate electronic documents. In accordance with one embodiment of the invention, each of a plurality of electronic communications is reduced to a corresponding multidimensional vector based on a multi-dimensional vector space. The multi-dimensional vectors represent corresponding electronic documents that have been classified as at least one type of electronic documents. Subsequent electronic documents to be classified are reduced to a corresponding multi-dimensional vector inserted into the multi-dimensional vector space. The electronic documents corresponding to an inserted multi-dimensional vector are classified based upon the proximity of the inserted multi-dimensional vector to at least one previously classified multi-dimensional vectors of the multi-dimensional vector space.

CLAIM OF PRIORITY

This application is a continuation of U.S. patent application Ser. No. 10/877,735, filed Jun. 24, 2004 now U.S. Pat. No. 7,519,565 and which is hereby incorporated by reference. This application is related to, and hereby claims the benefit of provisional application No. 60/517,010, entitled “Unicom Classifier,” which was filed Nov. 3, 2003 and which is hereby incorporated by reference.

FIELD

Embodiments of the invention relate generally to the field of electronic documents, and more specifically to methods and apparatuses for classifying such documents.

BACKGROUND

Electronic documents can be classified in many ways. Classification of electronic documents (e.g., electronic communications) may be based upon the contents of the communication, the source of the communication, and whether or not the communication was solicited by the recipient, among other criteria. For example, electronic communications may be classified as spam. Whether or not an electronic communication is spam is based upon the subjective opinion of the recipient, though generally spam is any unsolicited, non-consensual, electronic communication, typically of a commercial nature, and usually transmitted in bulk to many recipients. Spam includes unsolicited commercial e-mail (UCE), unsolicited bulk e-mail (UBE), gray mail, and just plain ‘junk mail,” and is typically used to advertise products.

Receiving and addressing spam is costly and annoying, so considerable effort is being made to detect spam and prevent its delivery to the intended recipient.

One prior art scheme for spam detection involves application of a rules-based filtering system. Such rules may be based on terms within the communication. For example, if the subject line of the communication includes the term “make money,” the communication may be determined to be spam. Such rules may also be based upon the absence of information. For example, if a communication does not identify the sender, the communication may be determined to be spam.

Such rules-based filtering schemes, while somewhat successful in determining spam, have several serious drawbacks. For example, such schemes usually employ hundreds or thousands of rules, each of which is formulated independently. The cost of developing such rules is prohibitive. Also, because each received electronic communication has to be validated against the myriad of rules, such schemes require expensive hardware to support the intensive computation that such validation requires. Moreover, spam senders are adept at changing the spam to avoid detection by such rules.

Another prior art scheme for detecting spam includes the use of statistical classifiers (e.g., a Bayesian classifier) that determine an electronic communication is spam based upon an analysis of words that occur frequently in spam. Such statistical classifier-based schemes can be defeated by various methods known to producers of spam (spammers). For example, spammers may encode the body of an electronic communication to avoid detection based upon words within the electronic communication.

More sophisticated statistical classifiers have recently been developed that classify communications based upon structural attributes of the communication. Such schemes, while addressing some of the drawbacks of previous statistical classification schemes, also have disadvantages in regard to computational resources.

Still another prior art scheme involves using the classification analysis of a community of users in order to classify electronic communications. In such a scheme, a number of users would identify a particular communication as spam. When the number of users identifying the particular communication as spam reached a specified threshold, the communication would be determined to be spam. This type of user-feedback classification scheme has disadvantages in terms of the length of time it takes to classify a communication.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention may be best understood by referring to the following description and accompanying drawings that are used to illustrate embodiments of the invention. In the drawings:

FIG. 1 illustrates a process in which electronic communications are reduced to corresponding multi-dimensional vectors based upon a defined multi-dimensional vector space in accordance with one embodiment of the invention;

FIG. 2 illustrates the reduction of a single electronic communication to a multi-dimensional vector based upon a defined multi-dimensional vector space in accordance with one embodiment of the invention;

FIG. 3A illustrates a process in which an electronic communication is classified in accordance with one embodiment of the invention;

FIG. 3B illustrates a process in which an electronic communication is classified in accordance with an alternative embodiment of the invention;

FIG. 4 illustrates a system for receiving and classifying electronic communications in accordance with one embodiment of the invention; and

FIG. 5 illustrates an embodiment of a digital processing system that may be used in accordance with one embodiment of the invention.

DETAILED DESCRIPTION

Overview

Embodiments of the invention provide methods and apparatuses for classifying electronic documents (e.g., electronic communications). In accordance with one embodiment of the invention, each of a plurality of electronic communications is reduced to a multidimensional vector (MDV) based on an MDV space. The MDVs represent the corpus of electronic documents that have been previously classified into one of a number of classifications. Subsequent electronic documents to be classified are reduced to a corresponding MDV and inserted into the MDV space. The electronic document corresponding to an inserted MDV is classified based upon the proximity of the inserted MDV to at least one previously classified MDVs of the MDV space.

In the following description, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In other instances, well-known circuits, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

Reference throughout the specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearance of the phrases “in one embodiment” or “in an embodiment” in various places throughout the specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

Moreover, inventive aspects lie in less than all features of a single disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

Process

FIG. 1 illustrates a process in which electronic documents are reduced to corresponding multidimensional vectors (MDVs) based upon a defined MDV space in accordance with one embodiment of the invention. Process 100, shown in FIG. 1, begins at operation 105 in which an MDV space is defined. The MDV space is defined by a plurality of features. Features may be of various types including words and or phrases contained within the body or header of the electronic documents. Features may also include electronic document genes. Such genes are defined as arbitrary functions that take the message as input and return a true/false value as output. Such functions can be inserted or modified as necessary and can use external information as additional inputs in determining a return value.

Domains of any hyperlinks found in the electronic documents may also be used as features as can domains present in the electronic document header. Additionally, the result of genes that operate on the header of the electronic document may be features. For one embodiment, the number of features includes approximately 5,000 words and phrases, 500 domain names and host names, and 300 genes.

Features can originate from various sources in accordance with alternative embodiments of the invention. For example, features can originate through initial training runs or user initiated training runs, or may originate through the runtime feature extractor as discussed in more detail below. In accordance with alternative embodiments, feature attributes may be stored for each feature. Such attributes may include a numerical ID that is used in the vector representation, feature type (e.g., ‘word’, ‘phrase’, ‘gene’, ‘domain’), feature source, the feature itself, or the category frequency for each of a number of categories. In accordance with one embodiment, the features may be selected based on their ability to effectively differentiate between communication categories or classifications. This provides features that are better able to differentiate between classifications.

FIG. 2 illustrates the reduction of a single electronic document to an MDV based upon a defined MDV space in accordance with one embodiment of the invention. As shown in FIG. 2, the defined MDV space feature set 205 includes features 1-N. Stage 210 illustrates an electronic document that is to be reduced to a MDV containing one occurrence each of features 2, 3, and 6, and two occurrences of feature 4.

The resulting MDV 215 is {0₁, 1₂, 1₃, 2₄, 0₅, 1₆, 0₇, 0₈, . . . 0_(N)}. The resulting MDV reflects which of the features that define the MDV space are present in the corresponding electronic communication, as well as the frequency with which each feature appears in that electronic communication. The resulting MDV has a zero element for each feature that does not appear in the corresponding electronic communication.

For one embodiment of the invention, each feature is weighted depending on the frequency of occurrence of the feature in the one or more electronic documents relative to the frequency of occurrence of each other feature in the at one or more electronic documents (term weight). For one embodiment of the invention, the feature may be weighted depending on the probability of the feature being present in an electronic document of a particular category (category weight). Alternatively, the feature may be weighted using a combination of term weight and category weight. Feature weighting emphasizes features that are rare and that are good spam/legit differentiators over features that are relatively common and that occur approximately equally often in spam and legit documents.

For one embodiment, the feature weights are used to scale the values of each MDV along their respective dimensions. For example, if a MDV was originally {0₁, 0₂, 1₃, 3₄, 4₅, 0₆, 0₇, 0₈, . . . 0_(N)}, and the feature weights are (1.1₁, 1₂, 3.2₃, 2.5₄, 0.5₅, 0₆, 0₇, 0₈, . . . 0_(N)), then for purposes of determining distance, as described below, the MDV is assumed to be {0₁, 0₂, 3.2₃, 7.5₄, 2₅, 0₆, 0₇, 0₈, . . . 0_(N)}.

Referring back to FIG. 1, at operation 110, a training set of electronic documents are reduced to MDVs based upon the defined MDV space. For one embodiment, the electronic documents are electronic communications such as e-mail messages (e-mails). For alternative embodiments the electronic documents may be other types of electronic communications including any type of electronic message including voicemail messages, short messaging system (SMS) messages, multi-media service (MMS) messages, facsimile messages, etc., or combinations thereof. Some embodiments of the invention extend beyond electronic communications to the broader category of electronic documents.

For one embodiment, each of the electronic communications of the training set is classified into one of a number of classifications. For example, each of the electronic communications of the training set may be classified as spam e-mail or legitimate e-mail for one embodiment. A spam electronic document is herein broadly defined as an electronic document that a receiver does not wish to receive, while a legitimate electronic document is defined as an electronic document that a receiver does wish to receive. Since the distinction between spam electronic documents and legitimate electronic documents is subjective and user-specific, a given electronic document may be a spam electronic document in regard to a particular user or group of users and may be a legitimate electronic document in regard to other users or groups of users.

At operation 115, the MDVs created from the electronic documents are used to populate the defined MDV space.

For one embodiment, the process of reducing a training set of electronic documents to MDVs includes identifying the features that comprise the MDV space and transforming emails into MDVs within that space. For one such embodiment, features are identified by evaluating a set of electronic documents (training set), each of which has been classified (e.g., classified as either spam e-mails or legitimate e-mails). The frequency with which each particular feature (e.g., word, phrase, domain, etc.) appears in the training set is then determined. The frequency with which each particular feature appears in each category of electronic communication is also determined. For one embodiment, a table that identifies these frequencies is created. From this information, features that occur often and are also good differentiators (i.e. occur predominantly in a particular category of electronic communication) are determined. For example, commonly occurring features that occur predominantly in spam e-mails (spam word features) or occur predominantly in legitimate e-mails (legit word features) can be determined. Legitimate e-mails are defined, for one embodiment, as non-spam emails. These often occurring good differentiator features are then selected as features of the MDV space. For one embodiment, the MDV space is defined by a set of features including approximately 2,500 spam word features and 2,500 legit word features. For one such embodiment, the MDV space is defined, additionally, by one feature for every gene. Each electronic document of the training set is then reduced to an MDV in the defined MDV space by counting the frequency of the word features in the document and applying each gene to the document. The resulting MDV is then added to the vector space.

The resulting MDV is stored as a sparse matrix (i.e., most of the elements are zero). As will be apparent to those skilled in the art, although described as multi-dimensional, each MDV may contain as few as one non-zero element.

In accordance with one embodiment, a part of the MDV space is retained for features that originate through the runtime feature extractor.

Classification and Nearest-Neighbor Selection

In accordance with one embodiment of the invention, a defined and populated MDV space can be used to classify electronic documents. A to-be-classified electronic document (subject electronic communication (SEC)) is reduced to an MDV based upon the defined MDV space and compared with the MDVs from the training set already populating the MDV space. Proximity of the MDV resulting from the SEC (subject MDV) to one or more training set MDVs of the MDV space leads to a determination that the SEC is of the same category (e.g., spam or legit) as the one or more training set MDVs that are most proximate to the subject MDV.

FIG. 3A illustrates a process in which an electronic communication is classified in accordance with one embodiment of the invention. Process 300A, shown in FIG. 3A, begins at operation 305A in which a SEC is reduced to a subject MDV based upon the MDV space as described above in reference to reducing a training set of electronic communications to MDVs. The MDV space containing a number of training set MDVs, each corresponding to a previously classified electronic communication.

At operation 310A, an approximate set of proximate MDVs is determined. That is, for one embodiment, an approximate set of nearest neighbor (ASNN) MDVs is determined and then further narrowed to k nearest neighbors (KNNs) as described below in reference to operation 320A. Conventional KNN-based classifiers find a set of nearest neighbors based on some distance metric by finding the distance of the target data point from the training dataset and finding the class from those nearest neighbors by some voting mechanism. However, the number of points in MDV space may be large and determining a distance based upon a specific distance metric may be computationally prohibitive. Therefore, for one embodiment of the invention, an approximate set of nearest neighbor (ASNN) MDVs is determined.

For one embodiment of the invention, the determination of an ASNN MDV is effected by partitioning the MDV space into regions and determining which region contains the KNNs of the subject MDV. For such an embodiment, the MDV space may be partitioned using a leader/follower process. Such a process includes randomly selecting a number of “leader” MDVs from within the MDV space; calculating the distance between each leader MDV and all of the remaining MDVs in the MDV space; and assigning each of the remaining MDVs to the closest leader MDV. Each leader MDV and all of the remaining MDVs are assigned to that leader (follower MDVs) form a region of the MDV space.

At operation 315A, the distance between the subject MDV and each of the MDVs of the ASNN MDVs is computed using a specific distance metric. For various alternative embodiments of the invention, any one of several specific distance metrics may be used. For example, a percentage of common dimensions distance metric in which the distance between two MDVs is proportional to the number of non-zero dimensions which the two MDVs have in common; a Manhattan distance metric in which the distance between two MDVs is the sum of the differences of the feature values of each MDV; and a Euclidean distance metric in which the distance between two MDVs is the length of the segment joining two vectors in the MDV space.

For one embodiment of the invention, a cosine similarity distance metric is used. A cosine similarity distance metric computes the similarity between two MDVs based upon the angle (through the origin) between the two MDVs. That is, the smaller the angle between two MDVs, the more similar the two MDVs are.

At operation 320A, each of the nearest neighbors of the ASNN MDVs is ordered by distance and the KNNs are evaluated. The number, k, of nearest neighbors may vary for alternative embodiments. For one embodiment, thresholding may be used to consider only neighbors that are within a threshold distance to the subject MDV. For one embodiment, the classification of the SEC is determined by a vote among the KNNs (e.g., if k=5 and 3 neighbors are in category S, then the classification of the new point is S). Or, for example, if the electronic communications corresponding to all (or most) of the k nearest neighbor MDVs were classified as spam, then the SEC would be classified as spam.

For one embodiment of the invention, the votes accorded each nearest neighbor are scaled based upon various criteria. For example, the votes of each neighbor may be scaled based on the distance between the neighbor and the subject MDV with nearer (more similar) neighbors receiving more votes.

For one alternative embodiment, the voting process described above, in reference to operation 320A, may not be required, and the distance between the subject MDV and each of the MDVs of the ASNN MDVs need not be computed as described above in reference to operation 315A. The distance computation may be terminated prior to determining the distance for each of the MDVs of the ASNN MDVs, if an MDV of the ASNN MDVs, is determined to be so near (similar) to the subject MDV that there is no justification in proceeding with the distance computation process and voting as described above. For example, if an MDV of the ASNN MDVs was completely similar to a subject MDV (i.e., the computer distance between them was zero), the subject MDV would be classified based upon the classification of the training set electronic communication corresponding to the completely similar MDV.

For one embodiment, a threshold level is specified. If the distance is below the specified threshold level the evaluation process is halted and the SEC is classified based upon the very proximate MDV.

Additionally, or alternatively, a second threshold may be specified. If, during the operation of computing the distance between the subject MDV and each of the MDVs of the ASNN MDVs, a specified number of the nearest neighbors are within the second specified threshold, the operation of computing the distance between the subject MDV and each of the MDVs of the ASNN MDVs is halted. At this point, the specified number of the nearest neighbors that are within the second specified threshold are deemed to be the KNNs and are evaluated as described above in reference to operation 320A.

As described above, a single MDV that is within a specified threshold distance to the subject MDV may negate the need for completing the distance computation process and KNN voting. A specified number of MDVs that are within a second (somewhat greater) distance may negate the need for completing the distance computation process, but may still be subject to an evaluation process (e.g., a vote among the KNNs). By the same token, each of the KNNs of the subject MDV may be so distant that no valid conclusion as to classification can be drawn. This may render the KNN voting futile as well. For example, if none of the MDVs of the ASNN MDVs are within a specified distance of the subject MDV then basing a classification on the KNNs may produce an erroneous classification, or at least dramatically lower the confidence in the classification.

For one embodiment of the invention, a distance threshold is specified. If there is no MDV within the distance threshold (i.e., an MDV similar enough to the subject MDV on which to confidently base a classification), then a fallback classification process is used. Such fallback classification processes may include conventional statistical classification schemes or other classification methods as known in the art.

FIG. 3B illustrates a process in which an electronic communication is classified in accordance with an alternative embodiment of the invention. Process 300B, shown in FIG. 3B, begins at operation 305B, in which an SEC is reduced to an MDV based upon the MDV space as described above in reference to operation 305A of process 300A.

At operation 310B, an ASNN MDVs is determined as described above in reference to operation 310A of process 300A.

At operation 315B, the distance between the subject MDV and one of the MDVs of the approximate set of nearest neighbor (ASNN) MDVs is computed. As each distance between each of the MDVs of the approximate set of KNNs and the subject MDV is computed, an evaluation is made at operation 316B to determine if the particular MDV of the approximate set of KNNs was within a first specified distance. The first specified distance is selected so that if an MDV of the ASNN MDVs is within the first specified distance, this would indicate a high degree of confidence in the particular MDV. Therefore, if the MDV of the ASNN MDVs is within the first specified distance, the electronic communication is classified based on the MDV of the ASNN MDVs that is within the first specified distance at operation 317B.

If at operation 316B, it is determined that the MDV is not within a first specified distance of the subject MDV then a determination is made at operation 318B as to whether a specified number of MDVs of the ASNN MDVs are within a second specified distance of the subject MDV. If so, an evaluation of the specified number of MDVs of the ASNN MDVs that are within the second specified distance is performed at operation 319B. For example, a vote is conducted among the specified number of MDVs of the ASNN MDVs that are within the second specified distance. This second specified distance is selected so as to provide confidence in an evaluation based upon a specified number of MDVs within the second specified distance. That is, it can be assumed with confidence that, if the calculation of the distances between the subject MDV and the remaining MDVs of the ASNN MDVs were continued, the MDVs within the specified second distance would be the nearest neighbors or at least that an evaluation based upon these MDVs would result in the same classification as an evaluation based upon the KNN MDVs.

At operation 323B a determination is made as to whether the evaluation process of operation 319B results in an unambiguous classification. If so, the electronic document is classified with the classification determined by the evaluation process of operation 319B. If at operation 323B it is determined that the evaluation process of operation 319B does not result in an unambiguous classification, then the electronic document is classified using a fallback classification scheme at operation 325B.

If, at operation 318B, it is determined that there is not a specified number of MDVs of the ASNN MDVs that are within a second specified distance of the subject MDV, then a determination is made at operation 320B as to whether the distance between the subject MDV and each of the ASNN MDVs has been computed. If not, the distance between another of the MDVs of the ASNN MDVs and the subject MDV is computed at operation 315B and the process continues as described above.

If, at operation 320B, the distance between the subject MDV and each of the ASNN MDVs has been computed, then a determination is made at operation 321B as to whether at least one of the MDVs of the ASNN MDVs are within a third specified distance of the subject MDV. If not, this indicates a lack of confidence in basing a classification of the electronic communication on an evaluation of the nearest neighbors of the subject MDV, and the electronic communication is classified using a fallback classification scheme at operation 325B.

If, at operation 321B, it is determined that one or more of the MDVs of the ASNN MDVs are within a third specified distance of the subject MDV, then an evaluation of the specified number of MDVs of the ASNN MDVs that are within the third specified distance is performed at operation 322B.

At operation 323B, a determination is made as to whether the evaluation process of operation 322B results in an unambiguous classification. If so, the electronic document is classified with the classification determined by the evaluation process of operation 322B. If at operation 323B it is determined that the evaluation process of operation 322B does not result in an unambiguous classification, then the electronic document is classified using a fallback classification scheme at operation 325B.

Thus, alternative embodiments of the invention provide mechanisms to expedite the classification process in view of heightened confidence in the classification result, or fallback to conventional schemes in view of insufficient confidence in the classification result.

For alternative embodiments of the invention, a more complex fallback process may be implemented. That is, fallback schemes may be employed that require a higher level of confidence in classifying an electronic communication as spam. This helps to prevent an erroneous classification of a legit e-mail as spam e-mail.

For one such embodiment, the KNNs of the subject MDV are determined. Any of the KNNs that are farther away than a specified distance are excluded. For those KNNs that are not so excluded, the number of spam votes and legit votes are tallied (this could be zero votes, if none of the KNNs are within the specified distance). A classification is made only if the number of votes for one classification (e.g., spam e-mail) receives a specified majority of the total number of votes and the total number of votes exceeds a specified threshold. For one embodiment of the invention, the specified majority is much greater than 50% (e.g., 85%). For example, assuming that the majority threshold is 85%, and the vote threshold is 0.8, and the vote tally of the non-excluded KNNs is as follows.

1. Spam, 0.26 votes

2. Spam, 0.26 votes

3. Spam, 0.26 votes

Although all of the KNNs are above the threshold and 100% of the votes are spam votes, the subject MDV is not classified as spam e-mail because the total number of votes is 0.78 (below the threshold for classification is 0.8).

As another example, using the same classification criteria, and assuming the vote tally of the non-excluded KNNs is as follows.

1. Spam, 0.8 votes

2. Spam, 0.7 votes

3. Legit, 0.3 votes

The subject MDV is not classified as spam e-mail because only 83.3% of the votes are spam votes (i.e., below the specified majority of 85%).

User-Specific Classifications

For one embodiment of the invention, user-specific preferences are specified. For such an embodiment, user-specific classifications are attached to the same MDV to enable user-specific preferences. For example, each MDV may have a default classification that applies to all users, and one or more other classifications that apply to particular users or groups of users whose opinions differ from the community of users overall. Vote tallying during the classification process uses the most specific classification that applies for the particular user (e.g., recipient of the email). For example, if an MDV has a classification specific to a particular user, then that classification is used for that user. If not, if the MDV has a classification that applies for a particular group of which the user is a member, then that classification is used. For example, the user may be a specific classification that applies to the “Engineering” group and the user may be a member of that group. If a user-specific or group-specific classification does not apply for to the MDV, then the default classification (applicable to all users) is used.

System

Embodiments of the invention may be implemented in a network environment. FIG. 4 illustrates a system for receiving and classifying electronic communications in accordance with one embodiment of the invention. System 400, shown in FIG. 4, illustrates a network of digital processing systems (DPSs) that may include a DPS 405 that originates and communicates electronic communication, and one or more client DPSs 410 a and 410 b that receive the electronic communications. System 400 may also include one or more server DPSs, shown as server DPS 415, through which electronic communications may be communicated.

The DPSs of system 400 are coupled one to another and are configured to communicate a plurality of various types of electronic communications or other stored content including documents such as web pages, content stored on web pages, including text, graphics, and audio and video content. For example, the stored content may be audio/video files, such as programs with moving images and sound. Information may be communicated between the DPSs through any type of communications network through which a plurality of different devices may communicate such as, for example, but not limited to, the Internet, a wide area network (WAN) not shown, a local area network (LAN), an intranet, or the like. For example, as shown in FIG. 4, the DPSs are interconnected one to another through Internet 420 which is a network of networks having a method of communicating that is well known to those skilled in the art. The communication links 402 coupling the DPSs need not be a direct link, but may be in direct links, including but not limited to, broadcasted wireless signals, network communications or the like. While exemplary DPSs are shown in FIG. 4, it is understood that many such DPS are interconnected.

In accordance with one embodiment of the invention, an electronic communication is originated at DPS 405 and communicated via internet 420 to DPS 410 a. The electronic communication classification application (ECCA) 411 a classifies the electronic communication in accordance with an embodiment of the invention as described above. For example, the electronic communication may be an e-mail message and may be classified as either spam e-mail or legit e-mail.

For an alternative embodiment, the electronic communication is originated at DPS 405 and communicated via internet 420 and server DPS 415 to client DPS 410 b. The ECCA 416 classifies the electronic communication in accordance with an embodiment of the invention as described above. For one embodiment, if the ECCA 416 classifies the electronic communication as spam, the electronic communication is not communicated to client DPS 410 b. For an alternative embodiment, if the ECCA 416 classifies the electronic communication as spam, the electronic communication is designated as such prior to communication to DPS 410 b.

Updating the MDV Space

Embodiments of the invention provide the capability of learning to classify new types of electronic communication on-the-fly. This allows the MDV space of the system, in accordance with one embodiment, to be updated (trained) at the client DPS (e.g., at the user's mail server). Such on-the-fly updating of the MDV space allows the user to mimic a mini training system, thus improving the classification system for the particular installation.

For example, a particular electronic communication may have no similar MDVs in the defined MDV space, rendering it difficult to classify in accordance with an embodiment of the invention. A particular user may know the classification of the electronic communication (at least in regards to that particular user). For example, if the electronic communication is known by the user to be an e-mail spam, the user may classify it as such and add a corresponding MDV to the MDV space. This is in contrast to prior art classification schemes that typically require recomputation of probabilities throughout the system when new data was added.

In addition, embodiments of the invention recall previous classifications, that is, an attempt to classify a document that has already been added to the vector space will always return the classification of that document. This is not always true for prior art systems (e.g., heuristic or Bayesian systems) where the overall trend for all documents often overwhelms a particular instance (e.g., a legitimate email containing a word typical in spam e-mails).

Embodiments of the invention allow for the incremental adaptation of the MDV pace by adding and removing points from the MDV space as needed. This allows on-going retraining and tailoring for classification of typical electronic communications of a particular user, and allows for recall to correct false classifications.

For example, if a particular point in the MDV space is very infrequently or never used as a k-nearest-neighbor, it is an uncommon, unrepresentative document that can safely be removed from the MDV space. This speeds up the classification process by allowing the classification system to ignore such documents.

Runtime Feature Extraction

As discussed above, embodiments of the invention allow for the MDV space to be updated on the fly with new MDVs, thus, allowing “online learning” while doing classification. For one embodiment of the invention, we can also perform runtime feature extraction, allowing the incremental addition of new features, on the fly, thus increasing the precision of the MDV space.

For one embodiment of the invention, the runtime feature extraction is implemented inline (i.e., as messages are processed). For example, for one embodiment of the invention, a copy of all feedback messages is saved and the training process described above in reference to FIG. 1 is periodically repeated on those documents, replacing any existing MDVs as necessary. For one such embodiment, a copy of the most recent N (e.g., 1000) e-mails, corresponding to user feedback MDVs is stored. The inline feature extraction mimics the initial training process, as described above, in regard to the stored e-mails. When a feature is present in a threshold amount (e.g., 1%) of the stored e-mails, that feature is used in defining the MDV space. Additionally, all of the most recent e-mails are reduced to MDVs using the new and existing features and are added to the MDV space, replacing any existing MDVs corresponding to the stored e-mails.

General Matters

Embodiments of the invention provide methods and apparatuses for classifying electronic communication. Although the classifications/categories for various embodiments of the invention have been discussed in terms of spam e-mails and legit e-mails, embodiments of the invention are equally applicable for discerning other classifications and more than two distinct classifications.

Embodiments of the invention provide many advantages over conventional prior art schemes as will be apparent to those skilled in the art. In addition to those advantages discussed above, embodiments of the invention provide other advantages including on-the-fly updating, dimension scaling, and run-time feature extraction, among others. Particular advantages will be discussed in greater detail below.

The invention includes various operations. Many of the methods are described in their most basic form, but operations can be added to or deleted from any of the methods without departing from the basic scope of the invention. The operations of the invention may be performed by hardware components or may be embodied in machine-executable instructions as described above. Alternatively, the steps may be performed by a combination of hardware and software. The invention may be provided as a computer program product that may include a machine-readable medium having stored thereon instructions, which may be used to program a computer (or other electronic devices) to perform a process according to the invention as described above.

FIG. 5 illustrates an embodiment of a digital processing system that may be used for the DPSs described above in reference to FIG. 4, in accordance with an embodiment of the invention. For alternative embodiments of the present invention, processing system 501 may be a computer or a set top box that includes a processor 503 coupled to a bus 507. In one embodiment, memory 505, storage 511, display controller 509, communications interface 513, and input/output controller 515 are also coupled to bus 507.

Processing system 501 interfaces to external systems through communications interface 513. Communications interface 513 may include an analog modem, Integrated Services Digital Network (ISDN) modem, cable modem, Digital Subscriber Line (DSL) modem, a T-1 line interface, a T-3 line interface, an optical carrier interface (e.g. OC-3), token ring interface, satellite transmission interface, a wireless interface or other interfaces for coupling a device to other devices. Communications interface 513 may also include a radio transceiver or wireless telephone signals, or the like.

For one embodiment of the present invention, communication signal 525 is received/transmitted between communications interface 513 and the cloud 530. In one embodiment of the present invention, a communication signal 525 may be used to interface processing system 501 with another computer system, a network hub, router, or the like. In one embodiment of the present invention, communication signal 525 is considered to be machine readable media, which may be transmitted through wires, cables, optical fibers or through the atmosphere, or the like.

In one embodiment of the present invention, processor 503 may be a conventional microprocessor, such as, for example, but not limited to, an Intel Pentium family microprocessor, a Motorola family microprocessor, or the like. Memory 505 may be a machine-readable medium such as dynamic random access memory (DRAM) and may include static random access memory (SRAM). Display controller 509 controls, in a conventional manner, a display 519, which in one embodiment of the invention may be a cathode ray tube (CRT), a liquid crystal display (LCD), an active matrix display, a television monitor, or the like. The input/output device 517 coupled to input/output controller 515 may be a keyboard, disk drive, printer, scanner and other input and output devices, including a mouse, trackball, trackpad, or the like.

Storage 511 may include machine-readable media such as, for example, but not limited to, a magnetic hard disk, a floppy disk, an optical disk, a smart card or another form of storage for data. In one embodiment of the present invention, storage 511 may include removable media, read-only media, readable/writable media, or the like. Some of the data may be written by a direct memory access process into memory 505 during execution of software in computer system 501. It is appreciated that software may reside in storage 511, memory 505 or may be transmitted or received via modem or communications interface 513. For the purposes of the specification, the term “machine readable medium” shall be taken to include any medium that is capable of storing data, information or encoding a sequence of instructions for execution by processor 503 to cause processor 503 to perform the methodologies of the present invention. The term “machine readable medium” shall be taken to include, but is not limited to, solid-state memories, optical disks, and magnetic disks.

While the invention has been described in terms of several embodiments, those skilled in the art will recognize that the invention is not limited to the embodiments described, but can be practiced with modification and alteration within the spirit and scope of the appended claims. The description is thus to be regarded as illustrative instead of limiting. 

1. A method for processing a training set of electronic documents for document processing, the method implemented by computer instructions executing on a computer processor, said method comprising: receiving said training set of electronic documents that are each assigned to two or more categories; determining a first set of frequencies with which a set of document features appear in the training set of electronic documents; determining a second set of frequencies with which the set of document features appear in each of the two or more categories of training the set of electronic documents; selecting a subset of said set of document features for defining a multi-dimensional vector space for processing documents, said subset of document features selected from said set of document features based upon said first set of frequencies and said second set of frequencies; and reducing each electronic document of the training set of electronic documents to a multi-dimensional vector in the multi-dimensional vector space.
 2. The method for processing a training set of electronic documents for document processing as set forth in claim 1, the method further comprising: reducing a new electronic document to a new multi-dimensional vector in the multi-dimensional vector space; determining a set of nearest neighbor multi-dimensional vectors from electronic documents in said training set to the new multi-dimensional vector; and computing a distance between said new multi-dimensional vector in the multi-dimensional vector space and each nearest neighbor multi-dimensional vector.
 3. The method for processing a training set of electronic documents for document processing as set forth in claim 2 wherein computing said distance comprises calculating a cosine similarity distance metric.
 4. The method for processing a training set of electronic documents for document processing as set forth in claim 2 wherein computing said distance comprises calculating a non-zero dimension proportionality metric.
 5. The method for processing a training set of electronic documents for document processing as set forth in claim 2 wherein computing said distance comprises calculating a Euclidean distance metric.
 6. The method for processing a training set of electronic documents for document processing as set forth in claim 2, the method further comprising: classifying the new electronic document based upon a proximity of the new multi-dimensional vector to each of the nearest neighbor multi-dimensional vectors.
 7. The method for processing a training set of electronic documents for document processing as set forth in claim 6 wherein said classifying said new electronic document comprises assigning said new electronic document a category of an electronic document from said training set if said distance is within a first threshold.
 8. The method for processing a training set of electronic documents for document processing as set forth in claim 6 wherein said classifying said new electronic document comprises assigning said new electronic document a category based upon a vote of a set of electronic documents from said training set that are within a second threshold distance from said new electronic document in said multi-dimensional space.
 9. The method for processing a training set of electronic documents for document processing as set forth in claim 6 wherein said classifying said new electronic document comprises analyzing a set of electronic documents from said training set that are within a third threshold distance from said new electronic document in said multi-dimensional space to determine a potential category for said new electronic document; and assigning said new electronic document said potential category based if said analyzing results in an unambiguous classification.
 10. A computer-readable medium, said computer-readable medium comprising a set of computer instructions that, when executed, implement a method for processing a training set of electronic documents for document processing, said method comprising: receiving said training set of electronic documents that are each assigned to two or more categories; determining a first set of frequencies with which a set of document features appear in the training set of electronic documents; determining a second set of frequencies with which the set of document features appear in each of the two or more categories of training the set of electronic documents; selecting a subset of said set of document features for defining a multi-dimensional vector space for processing documents, said subset of document features selected from said set of document features based upon said first set of frequencies and said second set of frequencies; and reducing each electronic document of the training set of electronic documents to a multi-dimensional vector in the multi-dimensional vector space.
 11. The computer-readable medium as set forth in claim 10, the method further comprising: reducing a new electronic document to a new multi-dimensional vector in the multi-dimensional vector space; determining a set of nearest neighbor multi-dimensional vectors from electronic documents in said training set to the new multi-dimensional vector; and computing a distance between said new multi-dimensional vector in the multi-dimensional vector space and each nearest neighbor multi-dimensional vector.
 12. The computer-readable medium as set forth in claim 11 wherein computing said distance comprises calculating a cosine similarity distance metric.
 13. The computer-readable medium as set forth in claim 11 wherein computing said distance comprises calculating a non-zero dimension proportionality metric.
 14. The computer-readable medium as set forth in claim 11 wherein computing said distance comprises calculating a Euclidean distance metric.
 15. The computer-readable medium as set forth in claim 11, the method further comprising: classifying the new electronic document based upon a proximity of the new multi-dimensional vector to each of the nearest neighbor multi-dimensional vectors.
 16. The computer-readable medium as set forth in claim 15 wherein said classifying said new electronic document comprises assigning said new electronic document a category of an electronic document from said training set if said distance is within a first threshold.
 17. The computer-readable medium as set forth in claim 15 wherein said classifying said new electronic document comprises assigning said new electronic document a category based upon a vote of a set of electronic documents from said training set that are within a second threshold distance from said new electronic document in said multi-dimensional space.
 18. The computer-readable medium as set forth in claim 15 wherein said classifying said new electronic document comprises analyzing a set of electronic documents from said training set that are within a third threshold distance from said new electronic document in said multi-dimensional space to determine a potential category for said new electronic document; and assigning said new electronic document said potential category based if said analyzing results in an unambiguous classification. 